package tech.eyao.hs60x.dao;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import tech.eyao.hs60x.mapper.LbsDOMapper;
import tech.eyao.hs60x.model.domain.LbsDO;

/**
 * lbs 数据操作
 * @author hejian
 * @date 2018年1月9日 下午2:13:53
 */
@Repository
public class LbsDao {
	@Autowired
	private LbsDOMapper lbsDOMapper;
	
	public boolean insert(LbsDO lbsDO) {
		lbsDO.setGmtCreated(new Date());
		lbsDO.setGmtModified(new Date());
		return lbsDOMapper.insert(lbsDO) > 0;
	}
	
	public List<LbsDO> getPageListByWatchId(long watchId,long id,Date startDate, Date endDate) {
		//return lbsDOMapper.getPageListByWatchId(watchId,pageNo > 0 ? (pageNo - 1) * pageSize : 0,pageSize);
		return lbsDOMapper.getPageListByWatchId(watchId, id, startDate, endDate);
	}
}
